<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // get请求的写法：传参形式：{ params: {a:1} }
        axios.get('/user', {
            params: {
                ID: 12345
            }
        }).then(function (response) {
            console.log(response);
        })


        // post请求的写法: 传参形式：{a:1}
        axios.post('/user', { ID: 12345 }).then(function (response) {
            console.log(response);
        })


        let params = { ID: 12345 }
        axios.get('/user', {
            params
        }).then(function (response) {
            console.log(response);
        })

        let mydata = { ID: 12345 }
        axios.post('/user', params ).then(function (response) {
            console.log(response);
        })

    </script>
</body>

</html>